#include <iostream>

using namespace std;

const int N = 3010;

typedef long long LL;

int n, m;
int v[20];
LL f[N];

int main() {
    cin >> n >> m;
    
    for (int i = 0; i < n; ++ i) scanf("%d", v + i);
    
    f[0] = 1;
    for (int i = 0; i < n; ++ i)
        for (int j = v[i]; j <= m; ++ j)
            f[j] += f[j - v[i]];
            
    cout << f[m] << endl;
    
    return 0;
}